﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp3
{
    class book
    {


        public int Num { get; set; }
        public string Name { get; set; }
        private int money;

        public int Money {
            get { return this.money; }
            set {
                if (value<0)
                {
                    value = 0;
                }
                this.money = value;
            } 
        }
        public string Press { get; set; }
        public string Writer { get; set; }
        public book()
        {
        }

        public book(int num, string name, int money, string press, string writer)
        {
           this.Num = num;
           this.Name = name;
           this.Money = money;
           this.Press = press;
           this.Writer = writer;
        }
        public void print()
        {
            Console.WriteLine("编号{0}，书名{1}，价格{2}，出版社{3}，作者{4}", this.Num, this.Name, this.Money, this.Press, this.Writer);
        }
    }
}
